package com.qf.commons.web.apiversion.register;

import com.qf.commons.web.apiversion.ApiVersionHandlerMapping;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * description:
 * author: Ken
 * 公众号：Java架构栈
 */
public class ApiVersionMappingRegister implements WebMvcRegistrations {

    /**
     * 注册返回自定义的HandlerMapping，替换掉SpringMVC默认的RequestMappingHandlerMapping
     * @return
     */
    @Override
    public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
        return new ApiVersionHandlerMapping();
    }
}
